/*
 * @Descripttion: 
 * @Author: chendingfengmail@163.com
 * @version: 
 * @Date: 2021-06-10 13:44:20
 * @LastEditors: chendingfengmail@163.com
 * @LastEditTime: 2021-06-30 08:20:58
 */
import {
  request
} from '../service'

const roleRight = {

  /**
   * 获取权限列表最大数 
   */
  findRoleRightMax(param) {
    return request({
      url: '/auth/roleRight/findMaxByAttributes',
      method: 'get',
      params: param
    })
  },

  /**
   * 获取角色权限列表
   */
  findRoleRightList(param) {
    return request({
      url: '/auth/roleRight/findByAttributes',
      method: 'get',
      params: param
    })
  },

  /**
   * 添加角色权限
   */
  addRoleRight(param) {
    return request({
      url: '/auth/roleRight/add',
      method: 'post',
      data: param
    })
  },

  /**
   * @param {角色权限ID} roleRightId
   */
  delRoleRight(roleRightId) {
    return request({
      url: '/auth/roleRight/delete/' + roleId,
      method: 'delete'
    })
  },

  /**
   * 更改角色权限
   * @param {更改角色权限} param
   */
  updateRoleRight(param) {
    return request({
      url: '/auth/roleRight/update',
      method: 'put',
      data: param
    });
  },
  
}

/**
 * 添加缺省参数值
 * @param {*} param 原始参数
 * @returns 携带缺省参数返回
 */
 function addDefaultParam(param) {
  let params = param;
  params['app'] = process.env.VUE_APP_SYSTEM_NAME;
  return params;
}

export default roleRight;
